/*
 * Copyright (C) 2011 Macambira Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package com.googlecode.entity;

import java.util.Scanner;

/**
 * Terminal teste
 * 
 * @version 0.1 06 Out 2011
 * @author Tony Silva | tony.silva@dce.ufpb.br
 */
public class Terminal {
    
    public static void main(String [] args) {
        
        Facade fac = new Facade();
        Scanner sc = new Scanner(System.in);
        int option = 1;
        while (option >=1){
            System.out.println();
            System.out.println("MENU PRINCIPAL");
            System.out.println();
            System.out.println("1 - Cadastrar Departamento");
            System.out.println("2 - Cadastrar Profesor");
            System.out.println("3 - Cadastrar Curso");
            System.out.println("0 - Para Sair");
            System.out.println();
            System.out.print("Opção: ");
            option = sc.nextInt();
            switch (option) {
                case 1:
                    // Cadastrar departamento
                    System.out.println();
                    System.out.print("Insira ID -> ");
                    fac.getDepartamento().setId(sc.next());
                    System.out.print("Insira o nome -> ");
                    fac.getDepartamento().setNome(sc.nextLine()); sc.nextLine();
                    fac.getcDepartamento().addDepartamento(fac.getDepartamento());
                    break;
                case 2:
                    // Cadatrar professor
                    System.out.println();
                    System.out.print("Insira ID -> ");
                    fac.getProfessor().setId(sc.next());
                    System.out.print("Insira o nome -> ");
                    fac.getProfessor().setNome(sc.nextLine()); sc.next();
                    System.out.print("Insira o numero do telefone -> ");
                    fac.getProfessor().setTelefone(sc.nextLine()); sc.next();
                    System.out.print("Insira o numero do telefone opcional -> ");
                    fac.getProfessor().setTelefoneOpcional(sc.nextLine()); sc.next();
                    System.out.print("Insira o email -> ");
                    fac.getProfessor().setEmail(sc.next());
                    fac.getcProfessor().addProfessor(fac.getProfessor());
                    break;
                case 3:
                    // Cadastrar curso
                    System.out.println();
                    System.out.print("Insira ID -> ");
                    fac.getCurso().setId(sc.next());
                    System.out.print("Insira o nome -> ");
                    fac.getCurso().setNome(sc.nextLine()); sc.nextLine();
                    fac.getcCurso().addCurso(fac.getCurso());
                    break;
        }
    }
        
        
        
        
        
        
    }
    
}
